package controller.room
{
	import events.room.EventRemoveRooms;
	
	import model.ModelProject;
	import model.ModelRooms;
	
	import org.flashIso.engine.base.IsoRoom;
	import org.robotlegs.mvcs.Command;
	
	public class CommandRemoveRooms extends Command
	{
		[Inject]
		public var event:EventRemoveRooms;
		
		[Inject]
		public var mr:ModelRooms;
		
		[Inject]
		public var mp:ModelProject;
		
		override public function execute() : void {
			mp.projectModified = true;

			var i:uint;
			for (i = 0; i < event.roomsToRemove.length; i++){
				mr.removeRoom(event.roomsToRemove[i] as IsoRoom);
			}
		}
	}
}